// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#include "precompiled.h"
#pragma warning( disable: 4786 )

#include "debug_message.h"

#if defined( _WIN32 )

	#include <windows.h>

	void do_debug_message( std::string const & file_line_str, char const * msg )
	{
		::OutputDebugString( ( file_line_str + " : " + msg + "\n" ).c_str() );
	}

#else // defined( _WIN32 )

	#include <iostream>

	void do_debug_message( std::string const & file_line_str, char const * msg )
	{
		std::clog << file_line_str + " : " + msg << std::endl;
	}

#endif // defined( _WIN32 )

	
#ifdef RELEASE_DEBUG_FILE_LOG_ON

	std::ofstream 		debug_logfile;
	
	void release_debug_open_log()
	{
		debug_logfile.clear();
		debug_logfile.open("debug_log_file.txt");
	}

	void __cdecl release_debug_log_out( std::string  string_buffer )
	{	
		debug_logfile << string_buffer ;
	}

	void release_debug_close_log()
	{
		debug_logfile.close();
	}

#endif // RELEASE_DEBUG_FILE_LOG_ON
